<template>
    <div>
        <Modal
         title="添加新地址"
         :value="value"
         @on-ok="save"
         @on-visible-change="visibleChange"
        >
            <Form :ref="formId" :rules="rules" :model="model" :label-width="80">
                <FormItem label="收货人" prop="personName">
                    <Input v-model="model.personName" :maxlength="32" :minlength="2"></Input>
                </FormItem>
            </Form>
            <div slot="footer">
                <Button @click="cancel">取消</Button>
                <Button @click="save" type="primary">保存</Button>
            </div>
        </Modal>
    </div>
</template>
<script lang="ts">
import { Component, Vue,Inject, Prop,Watch } from 'vue-property-decorator';
import Util from '../../lib/util'
import ModalBase from '../../lib/ModalBase'

@Component
export default class CreateUser extends ModalBase{
    model:any = {
        personName: "",
        phoneNumber: "",
        province: "",
        city: "",
        county: "",
        detailedAddress: "",
        isDefault: false,
    }
    rules = {
        personName:[{required: true, message:"", trigger: 'blur'}],
    }
    async saveFunc():Promise<Boolean> {
        var response = await this.post("MemberShippingAddress/Create", this.model);
        return response.success;
    }
}
</script>

